VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "ClsNodo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit

Public Event DataChanged()

'definicion de clases a contener
Public WithEvents orset As ClsRecordset
Attribute orset.VB_VarHelpID = -1

'definicion de atributos de la clase
Public codigo As String
Public nombre As String
Public descripcion As String

'Metodos constructor y destructor
Private Sub Class_Initialize()
    Set orset = New ClsRecordset
    orset.setCampos dbCampos(nod)
    orset.setTablas Array(nod)
End Sub
Private Sub Class_Terminate()
    Set orset = Nothing
End Sub
'Metodos de clase
Public Sub consulta()
    orset.consulta
End Sub
Public Sub consultaDatos(codig As String)
    orset.consulta Array(nod_id & "=" & codig & "")
    orset.CierraRec
End Sub
Public Sub Nuevo(nodnombre As String, noddescripcion As String)
    orset.sInsert Array("", nodnombre, noddescripcion)
End Sub
Public Sub Modificar(codig As String, nodnombre As String, noddescripcion As String)
    orset.sUpdate Array(codig, nodnombre, noddescripcion)
End Sub
Public Sub Borrar(nodid As String)
    orset.sDelete Array(nod_id & "=" & nodid & "")
End Sub
Private Sub Reload_members()
    With orset
        codigo = .getDato(nod_id)
        nombre = .getDato(nod_nombre)
        descripcion = .getDato(nod_descripcion)
    End With
    RaiseEvent DataChanged
End Sub
Private Sub orset_DataChanged()
    Reload_members
End Sub
